/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.DTO;

import Server.BUS.StringUlti;

/**
 *
 * @author Trung
 */
public class DeleteHaveWhereQuery extends DeleteQuery {
    public String whereString;
    
    public DeleteHaveWhereQuery()
    {
        super();
        whereString = "";
    }
    
    public DeleteHaveWhereQuery(String _queryString)
    {
        this.keyWord = "DELETE_HAVEWHERE";
        this.queryString = StringUlti.formatString(_queryString);
        
        int begin = this.queryString.indexOf("DELETE FROM") + "DELETE FROM".length();
        int end = this.queryString.indexOf("WHERE") - 1;
        this.tableName = this.queryString.substring(begin, end);
        this.tableName = this.tableName.trim();
        
        begin = this.queryString.indexOf("WHERE") + "WHERE".length();
        this.whereString = this.queryString.substring(begin);      
        this.whereString = this.whereString.trim();
    }

    /**
     * @return the whereString
     */
    public String getWhereString() {
        return whereString;
    }

    /**
     * @param whereString the whereString to set
     */
    public void setWhereString(String whereString) {
        this.whereString = whereString;
        this.whereString = StringUlti.formatString(this.whereString);
    }
}
